package edu.nf.meituan.dao.shop.impl;

import edu.nf.meituan.dao.shop.ShopTypeDAO;
import edu.nf.meituan.model.shop.ShopType;
import edu.nf.util.DBUtils;
import org.nf.db.util.SqlExecutor;
import org.nf.db.util.result.BeanListHandler;

import java.util.List;

public class ShopTypeDAOImpl implements ShopTypeDAO {
    @Override
    public List<ShopType> listShopType() {
        SqlExecutor sqlExecutor = new SqlExecutor(DBUtils.getConnection());
        BeanListHandler<ShopType> listHandler = new BeanListHandler<>(ShopType.class);
        String sql = "SELECT shop_type_id,shop_type_name FROM shop_type";
        return sqlExecutor.executeQuery(sql,listHandler);
    }
}
